package org.academic.texteditor.gui.component.toolbar;

import java.util.HashMap;
import java.util.Map;

import javax.swing.JToolBar;

public class ToolBarManager {

	private static ToolBarManager instance;
	private Map<String, JToolBar> toolbars;
	
	private ToolBarManager() {
		toolbars = new HashMap<String, JToolBar>();
	}
	
	static synchronized ToolBarManager getInstance() {
		if (instance == null) {
			instance = new ToolBarManager();
		}
		return instance;
	}
	
	public void addToolBar(JToolBar toolBar) {
		toolbars.put(toolBar.getName(), toolBar);
	}
	
	public JToolBar getToolBar(String name) {
		return toolbars.get(name);
	}
	
}
